<?php 
foreach ($this->websites as $site){

}
?>
<!-- Page statistics and control buttons area -->
    <div class="statsRow">
        <div class="wrapper statsItems">
        
            <!-- Stats item -->
            <div class="sItem ordersStats">
                <h2><a title="" class="value"><?php echo $this->allsites['count']?><span>Websites</span></a></h2>
                <div class="statsDetailed" id="s4">
                    <div class="statsContent">
                        <div class="sElements">
                            <div class="sDisplay"><h4><?php echo $this->active['count'];?></h4><span>approved</span></div>
                            
                            <div class="sDisplay"><h4><?php echo $this->blocked['count'];?></h4><span>blocked</span></div>
                        </div>
                        <span class="line"></span>
                        <div class="statsUpdate">
                            <span>Next update in:</span>
                            <span>1 hr 19 min</span>
                            <div class="contentProgress"><div class="barG tipS" id="bar4" title="89%"></div></div>
                        </div>
                        <div class="statsDropBtn"><a href="#" class="button basic"><img src="/images/icons/dark/stats.png" class="icon" alt="" /><span>View statistics</span></a></div>
                    </div>
                </div>
                <span class="changes">
                    <span class="negBar" values="5,10,15,20,25,30,35,40,45,50"></span>
                    <span class="negative">+0.6%</span>
                </span>
            </div>
			
			<div class="sItem ordersStats">
                <h2><a title="" class="value"><?php echo $this->adspaces['count'];?><span>Adspaces</span></a></h2>
                
                <span class="changes">
                    <span class="negBar" values="5,10,15,20,25,30,35,40,45,50"></span>
                    <span class="negative">+0.6%</span>
                </span>
            </div>
			
        </div>
    </div>
	<div class="line"></div>

    <!-- Main content wrapper -->
    <div class="wrapper">
    
        <!-- Dynamic table -->
        <div class="widget">
            <div class="title"><img src="/images/icons/dark/full2.png" alt="" class="titleIcon" /><h6>Dynamic table</h6></div>
            <table cellpadding="0" cellspacing="0" border="0" class="display dTable">
            <thead>
            <tr>
            <th>Дата добавления</th>
            <th>Логин публикатора</th>
            <th>Тематика сайта</th>
            <th>Адрес сайта</th>
			<th>Ключевые слова</th>
            <th>Кол-во рекламных мест</th>
			<th>Статус</th>
			<th>Категория</th>
            <th>Действия</th>
            </tr>
            </thead>
            <tbody>
            <?php
            if (!empty($this->websites)) {
            foreach ($this->websites as $site) {
             if($site['id_status_site'] == 1) {   
                echo '<tr class="gradeA">';
             }
             elseif ($site['id_status_site'] == 3){
                 echo '<tr class="gradeX">';
             }
                echo '<td>'.date("d-m-Y",strtotime($site['date_site'])).'</td>';
                echo '<td>'.$site['login'].'</td>';
                echo '<td>'.$site['category'].'</td>';
                echo '<td><a href="http://'.$site['url'].'" title="">'.$site['url'].'</a></td>';
                echo '<td>комп, монитор, хард</td>';
                echo '<td>12</td>';
                echo '<td>'.$site['status'].'</td>';
                if ($site['id_spec_status'] == 1) {
                    echo '<td>agent</td>';
                }
                elseif ($site['id_spec_status'] == 2){
                    echo '<td>user</td>';
                }
                if ($site['id_status_site'] == 3) {
                echo '<td><a href="'.$this->url(array(
                                                'module'     => 'back',
                                                'controller' => 'admin',
                                                'action'     => 'activatesite',
                                                'id'         => $site['id_site']
                                      )).'">'.$this->translate('activate ').'</a>';
                }
                elseif($site['id_status_site'] == 1) {
                    echo '<td><a href="'.$this->url(array(
                                                'module'     => 'back',
                                                'controller' => 'admin',
                                                'action'     => 'blocksite',
                                                'id'         => $site['id_site']
                                      )).'">'.$this->translate('block ').'</a>';
                }
                echo '<a href="#" title="">рекл.места</a>';
                echo '<a href="#" title="">статистика</a></td>';
                echo '</tr>';
            }
            }
            ?>
            </tbody>
            </table>  
        </div>
    </div>